<template>
  <div>
    <el-table
      :data="data"
      :border="true"
      :header-cell-class-name="$style.tableHeaderCell"
      v-loading="loading"
      tooltip-effect="dark"
      style="width: 100%"
      ref="storeTable"
    >
      <el-table-column align="center" min-width="150px" prop="channelName" label="门店名称" show-overflow-tooltip>
        <template slot-scope="scope">
          <div style="cursor:pointer;text-decoration:underline" @click="onOpenStoreDetailModal(scope.row)">
            {{ scope.row.channelName }}
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="100px" prop="storeCode" label="门店编码"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="channelCode" label="渠道编码"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="city" label="所在城市"></el-table-column>
      <el-table-column align="center" min-width="250px" prop="address" label="门店地址"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="cellularName" label="所属蜂窝"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="cellularCode" label="蜂窝编码"></el-table-column>
      <el-table-column align="center" min-width="60px" prop="storeLevel" label="门店类型"></el-table-column>
      <el-table-column align="center" min-width="150px" prop="operationManager" label="城市运营经理"></el-table-column>
      <el-table-column align="center" min-width="200px" prop="modify,lastModify" label="维护对象/时间">
        <template slot-scope="scope">
          {{ scope.row.modify }}/{{ scope.row.lastModify === undefined ? null : formatLastModify(scope.row.lastModify) }}
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="150px" prop="handleType" label="处理类型">
        <template slot-scope="scope">
          {{ transferHandleType(scope.row.handleType) }}
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="150px" prop="operate" label="操作">
        <template slot-scope="scope">
          <el-button type="text" @click="onDelete(scope.row)" :loading="deleting">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div :class="$style.tablePagination">
      <el-pagination
        @size-change="onPageSizeChange"
        @current-change="onPageNumChange"
        :current-page="currentPage"
        :page-sizes="[10, 15, 20, 50]"
        :page-size="pageSize"
        layout="total, prev, pager, next, sizes"
        :total="total"
      />
    </div>
  </div>
</template>
<style lang="scss" module>
@import './index.module.scss';
</style>

<script>
import Index from './index';
export default Index;
</script>
